package com.ymatou.iapi.sellertrading.testcase;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONObject;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.sellertrading.service.ModifyrecipientCall;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderResp;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.OrderCallService;
import com.ymttest.database.model.Ymt_Orders;
import com.ymttest.database.sqlwapper.modifyrecipientIMapper;

/**
 * Date:2017-01-11
 * @author chencan
 *
 */
public class Tc_modifyrecipient {
	private static ModifyrecipientCall modifyrecipientCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("业务说明：修改收件人信息");
	}

	@Before
	public void caseUp() {
		modifyrecipientCall = new ModifyrecipientCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(modifyrecipientCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_001() {
		Logger.start(true, "修改收件人信息17");
		try {
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			Logger.comment("前置数据准备结束");
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int ibuyerId = placeOrderResp.getUserId();
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			List<Ymt_Orders> history = new modifyrecipientIMapper()
					.selectiorderIds(ibuyerId);
			Ymt_Orders first = history.get(0);
			String receiveperson = first.getsReceivePerson();
			String address = first.getsAddress();
			String postcode = first.getsPostCode();
			String phone = first.getsPhone();
			String telephone = first.getsTelephone();

			Logger.verifyEquals(200, code, "code返回结果");
			Logger.verifyEquals("操作成功", msg, "描述");
			Logger.verifyEquals(name, receiveperson, "收件人");
			Logger.verifyEquals(addres, address, "收件人地址");
			Logger.verifyEquals(post, postcode, "收件人邮编");
			Logger.verifyEquals(phones, phone, "收件人电话");
			Logger.verifyEquals(teleps, telephone, "收件人手机");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_002() {
		Logger.start(true, "修改收件人信息--用户信息不正确");
		try {

			int sellerid = 3388883;
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			Logger.comment("前置数据准备结束");
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int ibuyerId = placeOrderResp.getUserId();
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(sellerid, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			System.out.println(msg);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_003() {
		Logger.start(true, "修改收件人信息--订单号不存在");
		try {

			int sellerid = 3383;
			int operateuserid = 3383;
			int orderid = 1222222;
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", orderid);

			JSONObject retBea = new ModifyrecipientCall(sellerid, operateuserid)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			System.out.println(msg);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_004() {
		Logger.start(true, "修改收件人信息--订单和用户不对应");
		try {

			int sellerid = 3383;
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			Logger.comment("前置数据准备结束");
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int ibuyerId = placeOrderResp.getUserId();
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(sellerid, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			System.out.println(msg);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_005() {
		Logger.start(true, "修改收件人信息--收件人信息为空");
		try {

			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			Logger.comment("前置数据准备结束");
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int ibuyerId = placeOrderResp.getUserId();
			String name = " ";
			String addres = " ";
			String post = " ";
			String phones = " ";
			String teleps = " ";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(200, code, "code返回结果");
			Logger.verifyEquals("操作成功", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_006() {
		Logger.start(true, "修改收件人信息--订单号为空");
		try {

			int sellerid = 3383;
			int operateuserid = 3383;
			int orderid = 0;
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", orderid);

			JSONObject retBea = new ModifyrecipientCall(sellerid, operateuserid)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("操作失败", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_007() {
		Logger.start(true, "修改收件人信息--用户信息为空");
		try {

			int sellerid = 0;
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int ibuyerId = placeOrderResp.getUserId();
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(sellerid, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("用户信息错误", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_008() {
		Logger.start(true, "修改收件人信息--待付款 1");
		try {
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			DecimalFormat df = new DecimalFormat("0.00");// 保留两位小数
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			// 接单
			new OrderCallService().acceptOrder(iorderId, sellerId);

			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("当前订单状态不能修改地址", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_009() {
		Logger.start(true, "修改收件人信息--已付款待接单 2");
		try {

			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			DecimalFormat df = new DecimalFormat("0.00");// 保留两位小数
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			// 接单
			new OrderCallService().acceptOrder(iorderId, sellerId);

			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("当前订单状态不能修改地址", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_0010() {
		Logger.start(true, "修改收件人信息--已发货 3");
		try {

			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			DecimalFormat df = new DecimalFormat("0.00");// 保留两位小数
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			// 接单
			new OrderCallService().acceptOrder(iorderId, sellerId);
			new OrderCallService().dispatched(iorderId, sellerId);

			List<Ymt_Orders> historys = new modifyrecipientIMapper()
					.selectoperateuserid(iorderId);
			Ymt_Orders firsts = historys.get(0);
			String names = firsts.getsReceivePerson();
			String saddress = firsts.getsAddress();
			String spost = firsts.getsPostCode();
			String sphone = firsts.getsPhone();
			String stelephone = firsts.getsTelephone();
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			List<Ymt_Orders> history = new modifyrecipientIMapper()
					.selectoperateuserid(iorderId);
			Ymt_Orders first = history.get(0);
			String receiveperson = first.getsReceivePerson();
			String address = first.getsAddress();
			String postcode = first.getsPostCode();
			String phone = first.getsPhone();
			String telephone = first.getsTelephone();

			List<Ymt_Orders> order = new modifyrecipientIMapper()
					.selectoperateuserid(iorderId);
			Ymt_Orders once = order.get(1);
			String person = once.getReceivePerson();
			String saddres = once.getAddress();
			String spostcode = once.getPostCode();
			String phonea = once.getPhone();
			String telephones = once.getTelephone();

			Logger.verifyEquals(200, code, "code返回结果");
			Logger.verifyEquals("操作成功", msg, "描述");
			Logger.verifyEquals(name, receiveperson, "收件人");
			Logger.verifyEquals(addres, address, "收件人地址");
			Logger.verifyEquals(post, postcode, "收件人邮编");
			Logger.verifyEquals(phones, phone, "收件人电话");
			Logger.verifyEquals(teleps, telephone, "收件人手机");
			Logger.verifyEquals(names, person, "收件人");
			Logger.verifyEquals(saddress, saddres, "收件人地址");
			Logger.verifyEquals(spost, spostcode, "收件人邮编");
			Logger.verifyEquals(sphone, phonea, "收件人电话");
			Logger.verifyEquals(stelephone, telephones, "收件人手机");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_0011() {
		Logger.start(true, "修改收件人信息--确认收货 4");
		try {

			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			// 接单
			new OrderCallService().acceptOrder(iorderId, sellerId);
			//非贝海发货
			new OrderCallService().dispatched(iorderId, sellerId);

			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("当前订单状态不能修改地址", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_0012() {
		Logger.start(true, "修改收件人信息--买家取消订单 12");
		try {
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			//取消订单
			new OrderCallService().cancelOrder(iorderId, sellerId);

			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("当前订单状态不能修改地址", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_0013() {
		Logger.start(true, "修改收件人信息--卖家取消订单 13");
		try {

			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			//取消订单
			new OrderCallService().cancelOrder(iorderId, sellerId);

			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("当前订单状态不能修改地址", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_0014() {
		Logger.start(true, "修改收件人信息--系统自动取消 18");
		try {
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			//取消订单
			new OrderCallService().cancelOrder(iorderId, sellerId);

			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			Logger.verifyEquals(201, code, "code返回结果");
			Logger.verifyEquals("当前订单状态不能修改地址", msg, "描述");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_modifyrecipient_0015() {
		Logger.start(true, "修改收件人信息--补款中16");
		try {
			PlaceOrderResp placeOrderResp = new OrderCallService()
					.createM2cOrder();
			int iorderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int ibuyerId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			BigDecimal totalPrice = placeOrderResp.getPayAmount();// 支付金额		
			// 支付订单
			new OrderCallService().orderPayRequest(ibuyerId, totalPrice,
					tradingId);
			// 接单
			new OrderCallService().acceptOrder(iorderId, sellerId);
			//补款
			BigDecimal payAmount = new BigDecimal(3);
			new OrderCallService().applyForPostPay(iorderId, sellerId,
					payAmount);

			List<Ymt_Orders> historys = new modifyrecipientIMapper()
					.selectoperateuserid(iorderId);
			Ymt_Orders firsts = historys.get(0);
			String names = firsts.getsReceivePerson();
			String saddress = firsts.getsAddress();
			String spost = firsts.getsPostCode();
			String sphone = firsts.getsPhone();
			String stelephone = firsts.getsTelephone();
			String name = "测试";
			String addres = "上海市闸北区珠江创意中心";
			String post = "20022";
			String phones = "18212055520";
			String teleps = "18212055520";

			Map<String, Object> map1 = new HashMap<String, Object>();
			map1.put("Receiver", name);
			map1.put("Address", addres);
			map1.put("PostCode", post);
			map1.put("Phone", phones);
			map1.put("Telephone", teleps);
			map1.put("OrderId", iorderId);

			JSONObject retBea = new ModifyrecipientCall(ibuyerId, ibuyerId)
					.callAndGetReturnData(map1);
			Integer code = retBea.getInt("Code");
			String msg = retBea.getString("Msg");

			List<Ymt_Orders> history = new modifyrecipientIMapper()
					.selectoperateuserid(iorderId);
			Ymt_Orders first = history.get(0);
			String receiveperson = first.getsReceivePerson();
			String address = first.getsAddress();
			String postcode = first.getsPostCode();
			String phone = first.getsPhone();
			String telephone = first.getsTelephone();

			List<Ymt_Orders> order = new modifyrecipientIMapper()
					.selectoperateuserid(iorderId);
			Ymt_Orders once = order.get(0);
			String person = once.getReceivePerson();
			String saddres = once.getAddress();
			String spostcode = once.getPostCode();
			String phonea = once.getPhone();
			String telephones = once.getTelephone();

			Logger.verifyEquals(200, code, "code返回结果");
			Logger.verifyEquals("操作成功", msg, "描述");
			Logger.verifyEquals(name, receiveperson, "收件人");
			Logger.verifyEquals(addres, address, "收件人地址");
			Logger.verifyEquals(post, postcode, "收件人邮编");
			Logger.verifyEquals(phones, phone, "收件人电话");
			Logger.verifyEquals(teleps, telephone, "收件人手机");
			Logger.verifyEquals(names, person, "收件人");
			Logger.verifyEquals(saddress, saddres, "收件人地址");
			Logger.verifyEquals(spost, spostcode, "收件人邮编");
			Logger.verifyEquals(sphone, phonea, "收件人电话");
			Logger.verifyEquals(stelephone, telephones, "收件人手机");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
